package com.ieei.client;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import com.ieei.iService.HelloWorld;
/**
 * JaxWsProxyFactoryBean 创建服务端和客户端
 *
 */
public class ClientJaxwsFactory {

	public static void main(String[] args) {
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		factory.getInInterceptors().add(new LoggingInInterceptor());
		factory.getOutInterceptors().add(new LoggingOutInterceptor());
		factory.setAddress("http://localhost:9000/helloWorld");
		HelloWorld client = factory.create(HelloWorld.class);
		System.out.println(client.sayHi("World"));
	}

}
